﻿CREATE TABLE [dbo].[t_Car] (
    [VIN]                      VARCHAR (18)   NOT NULL,
    [VIN_9]                    VARCHAR (9)    NULL,
    [Mileage]                  INT            NULL,
    [Make]                     VARCHAR (50)   NULL,
    [Model]                    VARCHAR (50)   NULL,
    [Series]                   VARCHAR (50)   NULL,
    [Body_Style]               VARCHAR (50)   NULL,
    [BodyStyleID]              INT            NULL,
    [SeriesID]                 INT            NULL,
    [Year]                     INT            NULL,
    [State]                    VARCHAR (2)    NULL,
    [VIN_Year]                 CHAR (1)       NULL,
    [Doors]                    TINYINT        NULL,
    [Color]                    VARCHAR (50)   NULL,
    [CarInfoOther]             NVARCHAR (50)  NULL,
    [Description]              AS             ((((CONVERT([varchar],[Year],(0))+isnull([Make],''))+isnull(','+[Model],''))+isnull(','+[Series],''))+isnull(','+[Body_Style],'')) PERSISTED,
    [DescriptionMMR]           NVARCHAR (256) NULL,
    [IsSUV]                    BIT            NOT NULL,
    [TrackingDeviceProviderID] INT            NOT NULL,
    [TrackerTypeID]            TINYINT        NOT NULL,
    [CarTypeID]                TINYINT        NOT NULL,
    [VIN_8]                    AS             (left([VIN],(8))) PERSISTED,
    [MMRInfo]                  VARCHAR (MAX)  NULL
);

